home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nebula 1
/
Nebula One.iso
/
Mail
/
pine3.92
/
pine
/
osdep
/
mimedisp
< prev
next >
Wrap
Text File
|
1996-02-07
|
1KB
|
58 lines
/*----------------------------------------------------------------------
Can we display this type/subtype?
Args: type -- the MIME type to check
subtype -- the MIME subtype
params -- parameters
use_viewer -- tell caller he should run external viewer cmd to view
Result: returns 1 if the type is displayable, 0 otherwise.
Note: we always return 1 for type text and type message, but sometimes
we set use_viewer and sometimes we don't.
----*/
mime_can_display(type, subtype, params, use_viewer)
int type;
char *subtype;
PARAMETER *params;
int *use_viewer;
{
int rv;
/* give mailcap a crack at everything first */
if(mailcap_can_display(type, subtype, params)){
if(use_viewer)
*use_viewer = 1;
rv = 1;
}
else{
if(use_viewer)
*use_viewer = 0;
switch(type){
/* if mailcap didn't want to handle these, we will */
case TYPETEXT:
case TYPEMESSAGE:
rv = 1;
break;
case TYPEAPPLICATION:
if(subtype && !strucmp(subtype, "DIRECTORY"))
rv = 1;
else
rv = 0;
break;
default:
rv = 0;
break;
}
}
return(rv);
}